]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: don't try to close the popup menu that is already destroyed
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Wed, 6 Dec 2017 05:55:37 +0000 (00:55 -0500)
committerMarco Trevisan (Treviño) <mail@3v1n0.net>
Wed, 17 Jan 2018 18:04:41 +0000 (13:04 -0500)
This would lead to a JS error otherwise, as we might end up
in deleting actors that have been already destructed.

https://bugzilla.gnome.org/show_bug.cgi?id=791233

js/ui/appDisplay.js

index 9b92311ac992ec2874cb682b8c67e05a9ef364b1..c309471a05de222de0bbdafb70aee19f7d0ce41f 100644 (file)
@@ -1872,11 +1872,14 @@ var AppIconMenu = new Lang.Class({
         this.actor.add_style_class_name('app-well-menu');
 
         // Chain our visibility and lifecycle to that of the source
-        source.actor.connect('notify::mapped', Lang.bind(this, function () {
+        this._sourceMappedId = source.actor.connect('notify::mapped', () => {
             if (!source.actor.mapped)
                 this.close();
-        }));
-        source.actor.connect('destroy', Lang.bind(this, this.destroy));
+        });
+        source.actor.connect('destroy', () => {
+            source.actor.disconnect(this._sourceMappedId);
+            this.destroy();
+        });
 
         Main.uiGroup.add_actor(this.actor);
     },